home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
DEMO_VGA
/
PLOTFRAC.LZH
/
GRAFIX.H
< prev
next >
Wrap
Text File
|
1987-10-23
|
3KB
|
98 lines
/*
G R A F I X . H
To use this package, make sure that your main() has the following
include definitions:
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
These are needed by the routines which call the BIOS ROM in the
IBM-PC and compatables. These routines will only work on the IBM-PC
or compatables; and are recommended for use only with Microsoft 'C'
Version 4.00 or later running under MS-DOS 3.10 or later.
*/
/*
H E X C O N S T A N T S
*/
#define ROM_BIOS 0x10 /* INT 10H calls the IBM-PC ROM
BIOS video driver services */
#define DOS_INT 0x21 /* MS-DOS Int. 21h service call */
#define PRN_OUTPUT 0x05 /* Function 05h sends output to PRN: */
#define SET_VI_MODE 0x00 /* Function 00h sets the video mode
calls. */
#define SET_PALETTE 0x0B /* Function 0Bh sets the color
palette for 320 X 200 medium-res */
#define WRITE_PIXEL 0x0C /* Function 0Ch writes a pixel at
location specified by CX & DX */
#define READ_PIXEL 0x0D /* Function 0Dh reads the value of
a graphics pixel at location
specified by CX & DX */
#define GET_DIS_MODE 0x0F /* Function 0Fh gets the current
display mode and saves all the
relevant information. */
#define SELECT_PAGE 0x05 /* Function 05h selects the current
active display page */
/*
F U N C T I O N D E C L A R A T I O N S
*/
extern void get_mode (void);
extern void set_mode (int);
extern void set_palette (int);
extern void set_background (int);
extern void plot_point (int, int, int);
extern void set_page (int);
extern void save_pic (char *, double *, int *);
extern void load_pic (char *);
extern int read_point (int, int);
extern void print_pic (void);
extern void prn_out (int);
/*
V A R I A B L E D E C L A R A T I O N S
*/
union REGS inregs, outregs;
struct SREGS segregs;
extern char P_BUFFER[350];
extern int bits[8];
extern int CURRENT_PAGE, /* Returned by get_mode() */
CURRENT_MODE, /* Returned by get_mode() */
PALETTE, /* Set by set_palette(Palette) */
BACKGROUND, /* Set by set_background(Background) */
USE_MODE; /* Set by set_mode(Mode) */
/* Palette = 1 or 0 when used with CGA modes 4 and 5 */
/* Background = 1 - 16 when used with CGA modes 4 or 5 */
/* Mode = 0 - 16 for various text and graphics displays.
Only Modes 0-6, 14 and 16 are supported currently.
0 = 40 x 25 B/W text, Color Adapter
1 = 40 x 25 Color Text
2 = 80 x 25 B/W Text
3 = 80 x 25 Color Text
4 = 320 x 200 4-Color Graphics
5 = 320 x 200 4-Color Graphics (One color only)
6 = 640 x 200 2-Color Graphics
14 = 640 X 200 16-Color Graphics (EGA with CGA or EGA monitor)
16 = 640 X 350 16-Color Graphics (EGA with EGA or Multi-sync monitor)
*/